<?php

/**
 * caisse actions.
 *
 * @package    SdCommerce
 * @subpackage caisse
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class caisseActions extends sfActions
{
 /**
  * Executes index action
  *
  * @param sfRequest $request A request object
  */
     public function executeGetAllCaisse() {
        $caisses = CaisseTable::getInstance()->findAll();
        $response = array();
        if (count($caisses) > 0) {
            foreach ($caisses as $i => $pro) {
                $caisse = array();
                $caisse["id"] = $pro->getId();
                
                $caisse["libelle"] = $pro->getLibelle();
               
                $response["caisses"][$i] = $caisse;
            }
            $response["success"] = 1;
        } else {
            $response["success"] = 0;
            $response["message"] = "No caisses found";
        }

        return $this->renderText(json_encode($response));
    }
    public function executeGetTotal(sfWebRequest $request){
        //$dateDeb=elli ba3thetou b telifouuuun
               $caisses = CaisseTable::getInstance()->CalculeSomm($dateDeb,$DateFin,$id);
 
        
    }
    
    
}
